broadway: Only use abstract sockets when they are supported
authorMatthias Clasen <mclasen@redhat.com>
Sun, 18 Jan 2015 20:24:30 +0000 (15:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 18 Jan 2015 20:24:30 +0000 (15:24 -0500)
GIO has a function to check whether abstract sockets are
supported, so use it. This should make broadway work on
Freebsd again.

https://bugzilla.gnome.org/show_bug.cgi?id=742980

gdk/broadway/broadwayd.c
gdk/broadway/gdkbroadway-server.c

index e1a0fc8a0b2cc429cf88a9cc90b073ee7240e401..feca655aeb28c9fbb8fb201cae154653d8fd5cf0 100644 (file)
@@ -456,10 +456,11 @@ main (int argc, char *argv[])
   if (display == NULL)
     {
 #ifdef G_OS_UNIX
-      display = ":0";
-#else
-      display = ":tcp";
+      if (g_unix_socket_address_abstract_names_supported ())
+        display = ":0";
+      else
 #endif
+        display = ":tcp";
     }
 
   if (g_str_has_prefix (display, ":tcp"))
index 9033e3e27b92fa1d3cd8516fd84aa0effdb28d92..40f1ca731fe7922109366053159493dd110757c0 100644 (file)
@@ -110,10 +110,11 @@ _gdk_broadway_server_new (const char *display, GError **error)
   if (display == NULL)
     {
 #ifdef G_OS_UNIX
-      display = ":0";
-#else
-      display = ":tcp";
+      if (g_unix_socket_address_abstract_names_supported ())
+        display = ":0";
+      else
 #endif
+        display = ":tcp";
     }
 
   if (g_str_has_prefix (display, ":tcp"))